/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.jomijushi.fid.dominio;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author miguel
 */
@Entity
@Table(name = "fid_item_venta_impresion", catalog = "fid", schema = "")
@NamedQueries({@NamedQuery(name = "FidItemVentaImpresion.findAll", query = "SELECT f FROM FidItemVentaImpresion f"), @NamedQuery(name = "FidItemVentaImpresion.findByFidItemVentaId", query = "SELECT f FROM FidItemVentaImpresion f WHERE f.fidItemVentaId = :fidItemVentaId")})
public class FidItemVentaImpresion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "fid_item_venta_id")
    private Integer fidItemVentaId;
    @JoinColumn(name = "fid_bobina_usada_id", referencedColumnName = "id")
    @ManyToOne
    private FidBobinaUsada fidBobinaUsadaId;
    @JoinColumn(name = "fid_item_venta_id", referencedColumnName = "id", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private FidItemVenta fidItemVenta;

    public FidItemVentaImpresion() {
    }

    public FidItemVentaImpresion(Integer fidItemVentaId) {
        this.fidItemVentaId = fidItemVentaId;
    }

    public Integer getFidItemVentaId() {
        return fidItemVentaId;
    }

    public void setFidItemVentaId(Integer fidItemVentaId) {
        this.fidItemVentaId = fidItemVentaId;
    }

    public FidBobinaUsada getFidBobinaUsadaId() {
        return fidBobinaUsadaId;
    }

    public void setFidBobinaUsadaId(FidBobinaUsada fidBobinaUsadaId) {
        this.fidBobinaUsadaId = fidBobinaUsadaId;
    }

    public FidItemVenta getFidItemVenta() {
        return fidItemVenta;
    }

    public void setFidItemVenta(FidItemVenta fidItemVenta) {
        this.fidItemVenta = fidItemVenta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fidItemVentaId != null ? fidItemVentaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FidItemVentaImpresion)) {
            return false;
        }
        FidItemVentaImpresion other = (FidItemVentaImpresion) object;
        if ((this.fidItemVentaId == null && other.fidItemVentaId != null) || (this.fidItemVentaId != null && !this.fidItemVentaId.equals(other.fidItemVentaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jomijushi.fid.dominio.FidItemVentaImpresion[fidItemVentaId=" + fidItemVentaId + "]";
    }

}
